# Snow CLI User Documentation - Installation Guide

Welcome to Snow CLI! Agentic coding in your terminal.

## Installation Guide

### 1. System Requirements

1. Operating System: Windows 10+ / macOS 10.15+ / Ubuntu 18.04+ / CentOS 7+

2. Node.js: v18.0.0+

3. npm: >= 8.3.0

### 2. Installing Node.js + npm

1. Windows: Download and install Node.js+npm from [https://nodejs.org/en/download/](https://nodejs.org/en/download/)

2. macOS: Install Node.js+npm via Homebrew

   ```bash
   brew install node
   ```

3. Linux: Install Node.js+npm via apt-get

   ```bash
   sudo apt-get install nodejs
   sudo apt-get install npm
   ```

4. Verify successful installation

   ```bash
   node -v
   npm -v
   ```

### 3. Installing Snow CLI and IDE Plugins

1. Install Snow CLI using npm

   ```bash
   npm install -g snow-ai
   ```

2. Install Snow CLI by compiling from source

   ```bash
   git clone https://github.com/MayDay-wpf/snow-cli
   cd snow-cli
   npm install
   npm run build
   npm run link
   ```

3. Verify successful installation

   ```bash
   snow --version
   snow --help
   ```

4. Install VSCode Plugin

   Search for `Snow CLI` in the Extensions Marketplace and install

   ![alt text](../images/image.png)
   After installation, a launch icon will appear in the top-right corner of VSCode

   ![alt text](../images/image1.png)

5. VSCode Extension Settings

   After installing the VSCode plugin, you can configure the following settings in `Settings` (search for `Snow CLI`):

   #### General

   - **Terminal Mode** (`snow-cli.terminalMode`): Choose the terminal display mode. Default is `sidebar`.
     - `sidebar` (default): Embeds a terminal in the sidebar panel.
     - `split`: Opens a terminal in a right-side editor split.
   - **Startup Command** (`snow-cli.startupCommand`): The command to run when the terminal starts. Default is `snow`. Supports comma-separated commands for round-robin assignment across multiple terminals.

   #### Terminal

   - **Shell Type** (`snow-cli.terminal.shellType`): Shell for the sidebar terminal. Default is `auto` to follow VS Code's default terminal profile. You can also specify a custom shell path (e.g., `C:\Program Files\Git\bin\bash.exe`, `/usr/bin/zsh`).
   - **Proxy URL** (`snow-cli.terminal.proxyUrl`): Optional proxy URL injected into Snow CLI terminals as `HTTP_PROXY`/`HTTPS_PROXY`. Three modes:
     - Leave empty to fall back to VS Code's `http.proxy` setting.
     - Set to `null` to explicitly disable the proxy and not inherit VS Code's `http.proxy`.
     - Set to a URL (e.g., `http://127.0.0.1:7890`) to use that proxy directly.
   - **Font Family** (`snow-cli.terminal.fontFamily`): Font family for the sidebar terminal. Leave empty to use the default monospace font.
   - **Font Size** (`snow-cli.terminal.fontSize`): Font size (px) for the sidebar terminal. Default is `14` (range: 8–32).
   - **Font Weight** (`snow-cli.terminal.fontWeight`): Font weight for the sidebar terminal. Default is `normal`. Options: `normal`, `bold`, or numeric values `100`–`900`.
   - **Line Height** (`snow-cli.terminal.lineHeight`): Line height for the sidebar terminal. Default is `1` (range: 0.8–2).
   - **Background Color** (`snow-cli.terminal.backgroundColor`): Background color for the sidebar terminal. Default is `#181818`. Supports any CSS color value, such as `#181818`, `rgb(24, 24, 24)`, or `var(--vscode-terminal-background)`.

   #### Terminal Bell

   - **Enabled** (`snow-cli.bell.enabled`): Enable terminal bell (BEL / `\x07`) notifications. Default is `true`. When disabled, both audio and visual feedback are suppressed.
   - **Sound** (`snow-cli.bell.sound`): Bell sound style. Default is `beep`. Options: `beep`, `ding`, `chime`, `pluck`, `blip`, `none` (visual flash only).
   - **Volume** (`snow-cli.bell.volume`): Terminal bell volume. Default is `0.5` (range: 0.0–1.0). Set to `0` to mute audio while still allowing visual flash.
   - **Visual Flash** (`snow-cli.bell.visualFlash`): Show a brief visual flash overlay on the terminal panel when the bell rings. Default is `true`.

   #### Git Blame

   - **Enabled** (`snow-cli.gitBlame.enabled`): Enable Git Blame annotations on the current line, similar to GitLens. Default is `false`.

   #### Inline Completion

   - **Enabled** (`snow-cli.completion.enabled`): Enable Snow CLI inline AI code completion. Default is `false`. When enabled, suggestions appear automatically while typing.
   - **Provider** (`snow-cli.completion.provider`): The request scheme used to talk to the completion model. Default is `chat`. Options:
     - `chat`: OpenAI-compatible Chat Completions API (e.g. OpenAI, DeepSeek chat, OpenRouter, vLLM, Ollama).
     - `fim`: OpenAI Completions API (FIM / Fill-In-the-Middle). Recommended for DeepSeek, Mistral codestral, etc.
     - `responses`: OpenAI Responses API.
     - `gemini`: Google Gemini API.
     - `anthropic`: Anthropic Messages API.
   - **Base URL** (`snow-cli.completion.baseUrl`): Base URL for the completion API. Leave empty to use the provider's default endpoint.
   - **API Key** (`snow-cli.completion.apiKey`): API Key for the completion provider. Stored in VS Code settings; consider using a workspace-only or restricted environment.
   - **Model** (`snow-cli.completion.model`): Model name used for inline completion. Use the `Snow CLI: Select Completion Model` command to fetch the list from the API.
   - **Max Tokens** (`snow-cli.completion.maxTokens`): Maximum tokens generated for each completion suggestion. Default is `256` (range: 16–4096).
   - **Temperature** (`snow-cli.completion.temperature`): Sampling temperature for completion. Default is `0.2` (range: 0–2). Lower values produce more deterministic suggestions.
   - **Debounce (ms)** (`snow-cli.completion.debounceMs`): Debounce delay before sending an automatic completion request after typing stops. Default is `400` (range: 50–5000).
   - **Context Prefix Lines** (`snow-cli.completion.contextPrefixLines`): Number of lines of code before the cursor sent as context. Default is `120` (range: 10–1000).
   - **Context Suffix Lines** (`snow-cli.completion.contextSuffixLines`): Number of lines of code after the cursor sent as context. Default is `40` (range: 0–500).
   - **Languages** (`snow-cli.completion.languages`): Language IDs where inline completion is active. Default is `["*"]` (all languages).
   - **Proxy** (`snow-cli.completion.proxy`): Optional HTTP/HTTPS proxy URL for completion API requests. Leave empty to use no proxy.

   #### Next Edit Prediction

   - **Enabled** (`snow-cli.nextEdit.enabled`): Enable Snow CLI Next Edit Prediction. Default is `false`. After you finish editing, similar locations in this file (or workspace) are highlighted so you can Tab-jump and apply the same change.
   - **Scope** (`snow-cli.nextEdit.scope`): Search scope used to find similar edit candidates. Default is `file`. Options: `file` (current file only), `workspace` (whole workspace, excluding `node_modules`, `dist`, `.git`, etc.).
   - **Use LSP References** (`snow-cli.nextEdit.useLspReferences`): When the edited token is a single identifier, query the language server for references first (more precise than text search). Default is `true`. Falls back to text search if no references are returned.
   - **Max Candidates** (`snow-cli.nextEdit.maxCandidates`): Maximum number of candidate locations queued per session. Default is `20` (range: 1–200).
   - **Min Pattern Length** (`snow-cli.nextEdit.minPatternLength`): Minimum length (in characters) of the changed text to trigger a prediction. Default is `2` (range: 1–20).
   - **Debounce (ms)** (`snow-cli.nextEdit.debounceMs`): Quiet period after typing stops before predictions are computed. Default is `350` (range: 50–5000).

6. Install JetBrains IDE Plugin

   Search for `Snow CLI` in the Plugin Marketplace and install

   After plugin installation, restart your IDE
   ![alt text](../images/image2.png)

   A launch icon will appear to the right of the `Tab` in the terminal

   ![alt text](../images/image3.png)
